{% extends "base.html" %}

{% block head-title %}{{algorithm.algorithm_name}}{% endblock %}

{% block title %}{{algorithm.algorithm_name}}{% endblock %}

{% block content %}
<div style="float: right;">
	<a href="/static/{{algorithm.instance_id}}/result.xlsx"
		class="uk-button uk-button-success" target="_blank">数据文件</a>
	<a href="/show_source_code?instance_id={{algorithm.instance_id}}"
		class="uk-button uk-button-primary" target="_blank">源代码</a>
</div>

{% ifequal algorithm.algorithm_name "最热APP应用" %}
<div>
	<a href="https://www.applehunt.com/top"
			class="uk-button uk-button-mini" target="_blank">打开所爬取的页面</a>
</div>
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>LOGO</th>
			<th>应用名称</th>
			<th>应用类别</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["应用", "类别", "应用图片URL地址"] -->
			<td>{{ forloop.counter }}</td>
			<td><img src="{{ value.2 }}" style="width:50px;"></td>
			<td>{{ value.0 }}</td>
			<td>{{ value.1 }}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% ifequal algorithm.algorithm_name "豆瓣电影" %}
<div>
	<a href="{{algorithm.movie_list_url}}"
			class="uk-button uk-button-mini" target="_blank">打开所爬取的页面</a>
</div>
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>海报</th>
			<th>电影</th>
			<th>评分</th>
			<th>点评</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["电影标题", "豆瓣评分", "一句话影评", "电影详情链接", "图片URL地址"] -->
			<td>{{ forloop.counter }}</td>
			<td><img src="/static/{{algorithm.instance_id}}/chart/{{ forloop.counter }}.png" style="width:100px;"/></td>
			<td><a href="{{ value.3 }}" target="_blank" title="点击查看详情">{{ value.0 }}</a></td>
			<td>{{ value.1 }}</td>
			<td>{{ value.2 }}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% ifequal algorithm.algorithm_name "新闻采集" %}
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>标题</th>
			<th>时间</th>
			<th>内容</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["新闻标题", "发布时间", "简短内容", "完整内容", "链接地址"] -->
			<td>{{ forloop.counter }}</td>
			<td><a href="{{ value.4 }}" target="_blank" title="点击查看详情">{{ value.0 }}</a></td>
			<td>{{ value.1 }}</td>
			<td>{{ value.2 }}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% ifequal algorithm.algorithm_name "历史天气" %}
<div>
	<a href="http://www.tianqi.com/"
			class="uk-button uk-button-mini" target="_blank">打开所爬取的页面</a>
</div>
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>日期</th>
			<th>最高气温</th>
			<th>最低气温</th>
			<th>天气</th>
			<th>风向</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["日期", "最高气温", "最低气温", "天气", "风向"] -->
			<td>{{ forloop.counter }}</td>
			<td>{{ value.0 }}</td>
			<td>{{ value.1 }}</td>
			<td>{{ value.2 }}</td>
			<td>{{ value.3 }}</td>
			<td>{{ value.4 }}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% ifequal algorithm.algorithm_name "微博内容" %}
<div>
	<a href="https://m.weibo.cn/u/{{algorithm.uid}}"
			class="uk-button uk-button-mini" target="_blank">打开所爬取的页面</a>
</div>
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>时间</th>
			<th>内容</th>
			<th>点赞</th>
			<th>评论</th>
			<th>转发</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["ID", "发布时间", "内容(HTML格式)", "点赞数", "评论数", "转发数"] -->
			<td>{{ forloop.counter }}</td>
			<td>{{ value.1 }}</td>
			<td>{% autoescape off %}{{ value.2 }}{% endautoescape %}</td>
			<td>{{ value.3 }}</td>
			<td>{{ value.4 }}</td>
			<td>{{ value.5 }}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% ifequal algorithm.algorithm_name "股票信息" %}
<table class="uk-table uk-table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>日期</th>
			<th>时间</th>
			<th>编码</th>
			<th>名称</th>
			<th>当前价格</th>
			<th>开盘价格</th>
			<th>今日最高</th>
			<th>今日最低</th>
			<th>K线图</th>
		</tr>
	</thead>
	<tbody>
		{% for value in algorithm.df.values %}
		<tr>
			<!-- ["代码0", "接口地址1", "K线图2", "日期3", "时间4", "名称5", 
			"今日开盘价6", "昨日收盘价7", "当前价格8", "今日最高价9", "今日最低价10"] -->
			<td>{{ forloop.counter }}</td>
			<td>{{ value.3 }}</td>
			<td>{{ value.4 }}</td>
			<td>{{ value.0 }}</td>
			<td>{{ value.5 }}</td>
			<td>{{ value.8 }}</td>
			<td>{{ value.6 }}</td>
			<td>{{ value.9 }}</td>
			<td>{{ value.10 }}</td>
			<td><a href="{{ value.2 }}" target="_blank">查看</a></td>
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endifequal %}

{% endblock %}